package com.intct.hbase.ddl.namespace;

import com.intct.hbase.util.HBaseConnection;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;

import java.io.IOException;

/**
 * @author gufg
 * @since 2025-07-10 11:10
 */
public class Drop {
    public static void main(String[] args) throws IOException {
        // 连接HBase
        Connection connection = HBaseConnection.getConnection();

        // 创建Admin实例
        Admin admin = connection.getAdmin();

        // 命名空间名称
        String namespaceName = "intct82_api";

        // 删除命名空间
        try {
            admin.deleteNamespace(namespaceName);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            // 关闭资源
            admin.close();
        }
    }
}
